<!DOCTYPE html>
<html lang="zh-CN">

    <#assign html_title="搬砖之家">
<head>
    <#include "/components/head.htm"   />
    <style>
        .widget {
            padding: 20px;
        }
        .table > thead > tr > th,
        .table > tbody > tr > th,
        .table > tfoot > tr > th,
        .table > thead > tr > td,
        .table > tbody > tr > td,
        .table > tfoot > tr > td {
            padding: 13px;
            line-height: 1.42857143;
            vertical-align: middle;
            border-top: 1px solid #ddd;
        }

        .loadEffect{
            width: 100px;
            height: 100px;
            position: relative;
            margin: 0 auto;
            margin-top:100px;
        }
        .loadEffect span{
            display: inline-block;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: lightgreen;
            position: absolute;
            -webkit-animation: load 1.04s ease infinite;
        }
        @-webkit-keyframes load{
            0%{
                opacity: 1;
            }
            100%{
                opacity: 0.2;
            }
        }
        .loadEffect span:nth-child(1){
            left: 0;
            top: 50%;
            margin-top:-8px;
            -webkit-animation-delay:0.13s;
        }
        .loadEffect span:nth-child(2){
            left: 14px;
            top: 14px;
            -webkit-animation-delay:0.26s;
        }
        .loadEffect span:nth-child(3){
            left: 50%;
            top: 0;
            margin-left: -8px;
            -webkit-animation-delay:0.39s;
        }
        .loadEffect span:nth-child(4){
            top: 14px;
            right:14px;
            -webkit-animation-delay:0.52s;
        }
        .loadEffect span:nth-child(5){
            right: 0;
            top: 50%;
            margin-top:-8px;
            -webkit-animation-delay:0.65s;
        }
        .loadEffect span:nth-child(6){
            right: 14px;
            bottom:14px;
            -webkit-animation-delay:0.78s;
        }
        .loadEffect span:nth-child(7){
            bottom: 0;
            left: 50%;
            margin-left: -8px;
            -webkit-animation-delay:0.91s;
        }
        .loadEffect span:nth-child(8){
            bottom: 14px;
            left: 14px;
            -webkit-animation-delay:1.04s;
        }
    </style>
</head>
 <body>
<div id="fullPage">
    <!--Page One-->
    <#include "/components/header.section.htm"   />

    <section>
        <div class="container">
            <div class="row">
                <div class="col-md-3">
                    <div class="widget white-block clearfix widget_categories">
                        <div class="widget-title-wrap">
                            <h4 class="widget-title"><i class="fa fa-angle-double-right"></i>订阅项目  </h4>
                        </div>
                        <ul>
                            <#list coins as coin>
                                <li style="padding: 5px;"> <a href="#${coin.coin}" data-coin="${coin.coin}" class="select-data">${coin.coin} (${coin.site_count})</a>
                                </li>
                            </#list>
                        </ul>
                    </div>

                </div>
                <div class="col-md-9">

                    <div id="dataDiv" class="white-block" style="padding: 20px;">
                        请选择订阅的项目
                    </div>
                    <div id="loadingDiv" style="position: absolute;top: 100px;left: 300px;display: none;">
                        <div class="loadEffect">
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>
</div>
<script>
    $(document).ready(function () {
        var timerId = -1;
        $('.select-data').click(function () {
            $('#loadingDiv').show();
            $('#dataDiv').load("/view/subscribe/data",{coin:$(this).data("coin")},function () {
                $('#loadingDiv').hide();
            });
            startTimer();
        });

        function queryData() {
            var hash = window.location.hash;
            if(hash != ""){
                $('#loadingDiv').show();
                $('#dataDiv').load("/view/subscribe/data",{coin:hash.substr(1)},function () {
                    $('#loadingDiv').hide();
                });
                startTimer();
            }
        }

        function startTimer() {
            if(timerId != -1){
                return;
            }
            timerId = setInterval(queryData,10*1000);
        }

        queryData();


    });

</script>
</body>

</html>